<template>
  <div id="">
    <!-- 三级已经注册为全局主键，不需要重新调用 -->
    <TypeNav></TypeNav>
    <ListContainer></ListContainer>
    <Recommend></Recommend>
    <Rank></Rank>
    <Like></Like>
    <Floor v-for="(v,i) in floorList" :key="v.id" :list="v"></Floor>
  
    <Brand></Brand>
  </div>
</template>

<script>
  import ListContainer from "./ListContainer/index.vue"
  import Recommend from "./Recommend/index.vue"
  import Rank from "./Rank/index.vue"
  import Like from "./Like/index.vue"
  import Brand from "./Brand/index.vue"
  import Floor from "./Floor/index.vue"

  import {
    mapState,
    mapMutations,
    mapGetters
  } from 'vuex'
  export default {
    name: "",
    data() {
      return {
        num: 3
      }
    },
    components: {
      ListContainer,
      Recommend,
      Rank,
      Like,
      Brand,
      Floor
    },
    methods: {
      //命名空间的调用方法
      // ...mapMutations('home', {
      // 	jian: 'JIAN'
      // }),
      // ...mapMutations('home', {
      // 	add: 'ADD'
      // })
     
    },
   async mounted() { //组件挂载完毕hou
      this.$store.dispatch("home/getFloorList")
      //获取用户信息在首页展示
    // try{
    //   await this.$store.dispatch("user/getUserInfo")
    // }catch(e){
    //   //TODO handle the exception
    //   console.log(e)
    // }
      
    },
    computed: {
      // ...mapState('home', {
      // 	count: 'count'
      // })
      ...mapState("home", {
        floorList: "floorList"
      })
    }
  }
</script>

<style>
</style>
